package com.senior.sendmessage.controller;

import com.senior.sendmessage.common.ResultResponse;
import com.senior.sendmessage.entity.Book;
import com.senior.sendmessage.service.BookService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author bjl_m
 */
@RestController
@RequiredArgsConstructor
public class BookController {
    private final BookService bookService;

    /**
     * @return com.senior.sendmessage.common.ResultResponse
     * @author baijiliang
     * @date 2022/5/11 19:11
     */
    @GetMapping(value = "/addBook")
    public ResultResponse addBook() {
        final Book book = Book.builder().address("下城区").name("名称").author("吴承恩").build();
        bookService.saveBook(book);
        return ResultResponse.success();
    }


}
